package com.ly.mp.component.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;

public class UserEntity implements Serializable {
    private static final long serialVersionUID = 7998181981118418576L;
    private String userName;
    private String userID;
    private String userPass;
    private String userType;
    private String empID;
    private String empName;
    private String orgID;
    private String enabled;
    private Date active_date;
    private Date disable_date;
    private String clientip;
    private String clientURL;
    private String companyid;
    private String companyreaid;
    private String orgcode;
    private String parentorgid;
    private String parentorgcode;
    private String orgname;
    private String parentorgname;
    private String orgtype;
    private String tmporgid;
    private String user_lan = "zh-CN";
    private String currdate;
    private int errnums;
    private String updatepwdtime;
    private String loginstatus;
    private String isbindwx;
    private String roleID;
    private String mobi;
    private String email;
    private String orglistid;
    private Date lastLoginTime;
    private String block;
    private String extField;
    private String userRealName;
    private List<TenantEntity> tenancyList;
    private String dynamicKey;
    private String deviceInfo;
    private String ccno;

    public String getRoleID() {
        return this.roleID;
    }

    public void setRoleID(String roleID) {
        this.roleID = roleID;
    }

    public String getOrglistid() {
        return this.orglistid;
    }

    public void setOrglistid(String orglistid) {
        this.orglistid = orglistid;
    }

    public String getIsbindwx() {
        return this.isbindwx;
    }

    public void setIsbindwx(String isbindwx) {
        this.isbindwx = isbindwx;
    }

    public String getMobi() {
        return this.mobi;
    }

    public void setMobi(String mobi) {
        this.mobi = mobi;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCcno() {
        return this.ccno;
    }

    public void setCcno(String ccno) {
        this.ccno = ccno;
    }

    public Date getActive_date() {
        return this.active_date;
    }

    public void setActive_date(Date active_date) {
        this.active_date = active_date;
    }

    public String getCurrdate() {
        return this.currdate;
    }

    public void setCurrdate(String currdate) {
        this.currdate = currdate;
    }

    public int getErrnums() {
        return this.errnums;
    }

    public void setErrnums(int errnums) {
        this.errnums = errnums;
    }

    public String getUpdatepwdtime() {
        return this.updatepwdtime;
    }

    public void setUpdatepwdtime(String updatepwdtime) {
        this.updatepwdtime = updatepwdtime;
    }

    public String getUser_lan() {
        return this.user_lan;
    }

    public void setUser_lan(String user_lan) {
        this.user_lan = user_lan;
    }

    public String getCompanyreaid() {
        return this.companyreaid;
    }

    public void setCompanyreaid(String companyreaid) {
        this.companyreaid = companyreaid;
    }

    public String getTmporgid() {
        return this.tmporgid;
    }

    public void setTmporgid(String tmporgid) {
        this.tmporgid = tmporgid;
    }

    public String getOrgcode() {
        return this.orgcode;
    }

    public void setOrgcode(String orgcode) {
        this.orgcode = orgcode;
    }

    public String getParentorgid() {
        return this.parentorgid;
    }

    public void setParentorgid(String parentorgid) {
        this.parentorgid = parentorgid;
    }

    public String getParentorgcode() {
        return this.parentorgcode;
    }

    public void setParentorgcode(String parentorgcode) {
        this.parentorgcode = parentorgcode;
    }

    public String getOrgname() {
        return this.orgname;
    }

    public void setOrgname(String orgname) {
        this.orgname = orgname;
    }

    public String getParentorgname() {
        return this.parentorgname;
    }

    public void setParentorgname(String parentorgname) {
        this.parentorgname = parentorgname;
    }

    public String getOrgtype() {
        return this.orgtype;
    }

    public void setOrgtype(String orgtype) {
        this.orgtype = orgtype;
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserID() {
        return this.userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUserPass() {
        return this.userPass;
    }

    public void setUserPass(String userPass) {
        this.userPass = userPass;
    }

    public String getUserType() {
        return this.userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getEmpID() {
        return this.empID;
    }

    public void setEmpID(String empID) {
        this.empID = empID;
    }

    public String getEmpName() {
        return this.empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public String getOrgID() {
        return this.orgID;
    }

    public void setOrgID(String orgID) {
        this.orgID = orgID;
    }

    public String getEnabled() {
        return this.enabled;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    public Date getDisable_date() {
        return this.disable_date;
    }

    public void setDisable_date(Date disable_date) {
        this.disable_date = disable_date;
    }

    public String getClientip() {
        return this.clientip;
    }

    public void setClientip(String clientip) {
        this.clientip = clientip;
    }

    public String getCompanyid() {
        return this.companyid;
    }

    public void setCompanyid(String companyid) {
        this.companyid = companyid;
    }

    public int hashCode() {
        int hashCode = 17;
        hashCode += null == this.getUserID() ? 0 : this.getUserID().hashCode() * 31;
        return hashCode;
    }

    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }

    public String getClientURL() {
        return this.clientURL;
    }

    public void setClientURL(String clientURL) {
        this.clientURL = clientURL;
    }

    public String getDynamicKey() {
        return this.dynamicKey;
    }

    public void setDynamicKey(String dynamicKey) {
        this.dynamicKey = dynamicKey;
    }

    public String getLoginstatus() {
        return this.loginstatus;
    }

    public void setLoginstatus(String loginstatus) {
        this.loginstatus = loginstatus;
    }

    public String getDeviceInfo() {
        return this.deviceInfo;
    }

    public void setDeviceInfo(String deviceInfo) {
        this.deviceInfo = deviceInfo;
    }

    public String getExtField() {
        return this.extField;
    }

    public void setExtField(String extField) {
        this.extField = extField;
    }

    private Map<String, String> extMap() {
        return (Map) (StringUtils.isNotBlank(this.extField)
                ? new ConcurrentHashMap()
                : (Map) JSON.parseObject(this.extField, new TypeReference<ConcurrentHashMap<String, String>>() {
                }, new Feature[0]));
    }

    public void putExt(String key, String value) {
        Map<String, String> ext = this.extMap();
        ext.put(key, value);
        this.setExtField(JSON.toJSONString(ext));
    }

    public void remove(String key) {
        Map<String, String> ext = this.extMap();
        ext.remove(key);
        this.setExtField(JSON.toJSONString(ext));
    }

    public String getExt(String key) {
        Map<String, String> ext = this.extMap();
        return (String) ext.get(key);
    }

    public Date getLastLoginTime() {
        return this.lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getBlock() {
        return this.block;
    }

    public void setBlock(String block) {
        this.block = block;
    }

    public String getUserRealName() {
        return this.userRealName;
    }

    public void setUserRealName(String userRealName) {
        this.userRealName = userRealName;
    }

    public List<TenantEntity> getTenancyList() {
        return this.tenancyList;
    }

    public void setTenancyList(List<TenantEntity> tenancyList) {
        this.tenancyList = tenancyList;
    }
}